package loupan_model

import (
	"hft/Database/admin"
	utils "hft/Http/Utils"
)

type Result struct {
	ID uint `json:"id"`
}

// 楼盘列表
type LouPan struct {
	ID              int                   `json:"id"`
	Name            string                `json:"name"`
	Sort            int                   `json:"sort"`
	Cover           string                `json:"cover"`
	BelongName      string                `json:"belong_name"`
	Grounding       int                   `json:"grounding"`
	ReferencePrice  int                   `json:"reference_price"`
	Region          int                   `json:"region"`
	Status          int                   `json:"status"`
	StatusName      string                `json:"status_name"`
	StatusColor     string                `json:"status_color"`
	StatusTextColor string                `json:"status_text_color"`
	Residential     int                   `json:"residential"`
	CreateTime      string                `json:"create_time"`
	ActiveLastTime  int                   `json:"active_last_time"`
	SellPhone       string                `json:"sell_phone"` //分机号
	MinArea         int                   `json:"min_area"`
	MaxArea         int                   `json:"max_area"`
	Tags            []string              `json:"tags"`
	Disadvantage    []*admin.Disadvantage `json:"disadvantage"`
}

type DBLouPan struct {
	admin.LouPan
	Garrison int `gorm:"garrison"`
}

// 驻守人员
type Garrison struct {
	ID       uint   `json:"id"`
	RealName string `json:"real_name"`
	Phone    string `json:"phone"`
	Avatar   string `json:"avatar"`
}

type GetGarrison struct {
	utils.Page
	LouID int `form:"lou_id"`
}

// 解除驻守
type ReleaseBody struct {
	BrokerID int `json:"broker_id"`
	LouID    int `json:"lou_id"`
}

// 添加驻守人员
type AddBody struct {
	Brokers []int `json:"brokers"`
	LouID   int   `json:"lou_id"`
}

// 该楼盘可以添加的驻守
type CanAddBrokerInThisLouPan struct {
	ID       uint   `json:"id" gorm:"column:id"`
	RealName string `json:"real_name" gorm:"column:real_name"`
	Avatar   string `json:"avatar" gorm:"column:avatar"`
	Phone    string `json:"phone" gorm:"column:phone"`
}

type FindLouPanTag struct {
	LouPanID uint
	Name     string
}

type FindRank struct {
	admin.Disadvantage
	LouPanID uint
}
